package com.example.sunsg.okhttptest.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

/**
 * Created by sunsg on 15/9/23.
 */
public class User implements Parcelable {
    private String id;
    private String name;

    @SerializedName("is_friend")
    private boolean isFriend;

    @SerializedName("avatar_s")
    private String avatarS;

    @SerializedName("avatar_m")
    private String avatarN;

    @SerializedName("avatar_l")
    private String avatarL;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isFriend() {
        return isFriend;
    }

    public void setIsFriend(boolean isFriend) {
        this.isFriend = isFriend;
    }

    public String getAvatarS() {
        return avatarS;
    }

    public void setAvatarS(String avatarS) {
        this.avatarS = avatarS;
    }

    public String getAvatarN() {
        return avatarN;
    }

    public void setAvatarN(String avatarN) {
        this.avatarN = avatarN;
    }

    public String getAvatarL() {
        return avatarL;
    }

    public void setAvatarL(String avatarL) {
        this.avatarL = avatarL;
    }



    @Override
    public String toString() {
        return "User{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", isFriend=" + isFriend +
                ", avatarS='" + avatarS + '\'' +
                ", avatarN='" + avatarN + '\'' +
                ", avatarL='" + avatarL + '\'' +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeString(this.name);
        dest.writeByte(isFriend ? (byte) 1 : (byte) 0);
        dest.writeString(this.avatarS);
        dest.writeString(this.avatarN);
        dest.writeString(this.avatarL);
    }

    public User() {
    }

    public User(String id, String name) {
        this.id = id;
        this.name = name;
    }

    protected User(Parcel in) {
        this.id = in.readString();
        this.name = in.readString();
        this.isFriend = in.readByte() != 0;
        this.avatarS = in.readString();
        this.avatarN = in.readString();
        this.avatarL = in.readString();
    }

    public static final Parcelable.Creator<User> CREATOR = new Parcelable.Creator<User>() {
        public User createFromParcel(Parcel source) {
            return new User(source);
        }

        public User[] newArray(int size) {
            return new User[size];
        }
    };
}
